import React from 'react';
import TeacherInformationTable from '../dumb/TeacherInformationTable';
import * as TeachersInformationListStyle from './TeachersInformationList.less'


export default class TeachersInformationList extends React.Component {
    static propTypes = {
        name: React.PropTypes.string,
        detail: React.PropTypes.array,

    }

    constructor(props) {
        super(props);
    }
 

    render() {
        let { detail=[] } = this.props;
        let items = detail.map((item,index)=>
                <li key={index} className={(index%2)==0?'haveABackgroundColor':'haveNotABackgroundColor'}>
                    <span key={'教师姓名'+index}><em>{item.info.name||'-'}</em></span>
                    <span key={'学校'+index}><em>{item.info.school.text||'-'}</em></span>
                    <span key={'学科'+index}><em>{item.info.subject.text||'-'}</em></span>
                    <span key={'年级'+index}><em>{item.info.grade.text||'-'}</em></span>
                   <TeacherInformationTable teachersInformation={item.info} />
                </li>)
    
        return (
            <div className={TeachersInformationListStyle.teachersInformationList}>
                <div>
                    <span><b>教师姓名</b></span>
                    <span><b>学校</b></span>
                    <span><b>学科</b></span>
                    <span><b>年级</b></span>
                    <span><b>教学日志</b></span>
                </div>
                <ul>
                    {items}
                </ul>
            </div>
        );
    }
}